import request from '@/utils/request';
import { UserFeedbackQuery, UserFeedbackVO, UserFeedbackForm } from './types'

// 查询用户反馈列表
export const getUserFeedbackList = (params: UserFeedbackQuery) => {
    return request({
        url: '/user/feedback/list',
        method: 'get',
        params
    })
}

// 获取用户反馈详细信息
export const getUserFeedback = (id: number) => {
    return request({
        url: `/user/feedback/${id}`,
        method: 'get'
    })
}

// 新增用户反馈
export const addUserFeedback = (data: UserFeedbackForm) => {
    return request({
        url: '/user/feedback',
        method: 'post',
        data
    })
}

// 修改用户反馈
export const updateUserFeedback = (data: UserFeedbackForm) => {
    return request({
        url: '/user/feedback',
        method: 'put',
        data
    })
}

// 删除用户反馈
export const deleteUserFeedback = (ids: number[]) => {
    return request({
        url: `/user/feedback/${ids}`,
        method: 'delete'
    })
}
